package com.ruike.alisurface.ui.adapters;


import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.ruike.alisurface.R;
import com.ruike.alisurface.bean.ShopInfoBean;
import com.voodoo.lib_utils.imageLoader.GlideImageLoader;

import java.util.List;

public class ShopCarAdapter extends BaseQuickAdapter< ShopInfoBean.DataBean, BaseViewHolder> {
   Context mContext;
    public ShopCarAdapter(@LayoutRes int layoutResId, @Nullable List< ShopInfoBean.DataBean> data, Context context) {
        super(layoutResId, data);
        mContext=context;
    }

    @Override
    protected void convert(BaseViewHolder helper,ShopInfoBean.DataBean item) {
        ImageView  productimg = helper.getView(R.id.car_productimg_img);
        TextView  productname = helper.getView(R.id.car_productname_tv);
        TextView    price = helper.getView(R.id.car_price_tv);
        GlideImageLoader.getInstance().loadImage(mContext, item.getProductimg(), productimg);
        productname.setText(item.getProductname());
        price.setText("￥ " + item.getPrice());
        //获取当前item的position
        //int position = helper.getLayoutPosition();
    }
 }
